//package com.itheima.service.impl;
//
//import com.itheima.mapper.RoleMapper;
//import com.itheima.mapper.UserMapper;
//import com.itheima.pojo.Permission;
//import com.itheima.pojo.Role;
//import com.itheima.pojo.User;
//import com.itheima.service.UserService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//
//@Service
//public class UserServiceImpl implements UserService {
//
//    @Autowired
//    private UserMapper userMapper;
//    @Autowired
//    private RoleMapper roleMapper;
//
//    //通过用户名获取用户信息
//    @Override
//    public User findByUsername(String username) {
//        User user = userMapper.findByUsername(username);
//        return user;
//    }
//
//    // 根据用户ID查询用户的角色
//    @Override
//    public List<Role> findRolesByUserId(Long userId) {
//        List<Role> roles =userMapper.findRolesByUserId(userId);
//        return roles;
//    }
//
//    // 根据角色ID查询角色的权限
//    @Override
//    public List<Permission> findPermissionsByRoleId(Long roleId) {
//        List<Permission> permissions =roleMapper.findPermissionsByRoleId(roleId);
//        return permissions;
//    }
//}
